package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Department;
import cn.wolfcode.crm.mapper.DepartmentMapper;
import cn.wolfcode.crm.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements IDepartmentService{
    @Autowired
    DepartmentMapper mapper;
    public void deleteByPrimaryKey(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void insert(Department record) {
        mapper.insert(record);
    }

    public Department selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    public List<Department> selectAll() {
        return mapper.selectAll();
    }

    public void updateByPrimaryKey(Department record) {
        mapper.updateByPrimaryKey(record);
    }

//    public PageResult query(QueryObject qo) {
//        int total = mapper.queryForCount(qo);
//        if (total == 0) {
//            return new PageResult();
//        }
//        List<Department> rows = mapper.queryForList(qo);
//        return new PageResult(rows, total);
//    }
}
